#    One Room And A Goblin Invasion
#    Copyright (C) 2014  Jannik Haberbosch
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.

import pygame
pygame.init()

import random

from code import helpers


class Garbage( pygame.sprite.Sprite ):
	"""

	"""

	# Static images
	broken_glass = None
	cutlery = None
	soap = None
	paper = None
	dvd = None
	scattered_leaves = None
	socks = None

	# Areas.
	kitchen_area = None
	dining_area = None
	bathroom_area = None
	living_room_area = None
	plants_area = None
	computer_area = None
	bedroom_area = None


	def __init__( self, position_center ):
		"""

		"""
		pygame.sprite.Sprite.__init__( self )

		self.position_center = position_center

		self.image = random.choice(
			(
				Garbage.broken_glass,
				Garbage.cutlery,
				Garbage.soap,
				Garbage.paper,
				Garbage.socks,
				Garbage.dvd,
				Garbage.scattered_leaves
			)
		).copy()

		self.rect = self.image.get_rect(
			center = self.position_center
		)


	@staticmethod
	def set_areas(
		coords_kitchen_area,
		coords_dining_area,
		coords_bathroom_area,
		coords_living_room_area,
		coords_plants_area,
		coords_computer_area,
		coords_bedroom_area
		):
		"""

		"""
		Garbage.kitchen_area = pygame.Rect(
			*coords_kitchen_area
		)
		Garbage.dining_area = pygame.Rect(
			*coords_dining_area
		)
		Garbage.bathroom_area = pygame.Rect(
			*coords_bathroom_area
		)
		Garbage.living_room_area = pygame.Rect(
			*coords_living_room_area
		)
		Garbage.plants_area = pygame.Rect(
			*coords_plants_area
		)
		Garbage.computer_area = pygame.Rect(
			*coords_computer_area
		)
		Garbage.bedroom_area = pygame.Rect(
			*coords_bedroom_area
		)
	

	@staticmethod
	def load_images(
		img_broken_glasses,
		img_cutlery,
		img_soap,
		img_paper,
		img_dvd,
		img_scattered_leaves,
		img_socks
		):
		"""

		"""
		Garbage.broken_glass = helpers.load_image(
			img_broken_glasses
		)
		Garbage.cutlery = helpers.load_image(
			img_cutlery
		)
		Garbage.soap = helpers.load_image(
			img_soap
		)
		Garbage.paper = helpers.load_image(
			img_paper
		)
		Garbage.dvd= helpers.load_image(
			img_dvd
		)
		Garbage.scattered_leaves = helpers.load_image(
			img_scattered_leaves
		)
		Garbage.socks = helpers.load_image(
			img_socks
		)
